<template>
  <view class="container">
    <tui-button type="primary" shape="circle" class="admin-button" @click="goUsers">用户</tui-button>
    <tui-button type="primary" shape="circle" class="admin-button" @click="goFeedbacks">解析源反馈</tui-button>
    <tui-button type="primary" shape="circle" class="admin-button" @click="goSources">解析源</tui-button>
  </view>
</template>

<script>
import { mapState } from "vuex";
import tuiButton from "@/components/button/button";
export default {
  components: {
    tuiButton
  },
  data() {
    return {};
  },
  computed: mapState(["config"]),
  onLoad() {
    if (!this.config.admin) {
      this.tui.toast("您不是管理员！");
      setTimeout(() => {
        uni.navigateBack({
          delta: 1
        });
      }, 1000);
      return;
    }
  },
  methods: {
    goUsers() {
      uni.navigateTo({
        url: "/pages/admin/users"
      });
    },
    goFeedbacks() {
      uni.navigateTo({
        url: "/pages/admin/feedbacks"
      });
    }
  }
};
</script>

<style lang="scss">
page {
  height: 100%;
}
.container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.admin-button {
  width: 80%;
  margin-bottom: 20upx;
}
</style>
